package com.yn.scinsp.intercept;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.yn.core.meta.PageIntercept;
import com.yn.core.plugins.dao.Db;
import com.yn.core.plugins.dao.Md;

public class ScinspIntercept extends PageIntercept{
	/**
	 * 获取巡点检专业
	 * @return
	 */
	public Map<String, Object> getSpecSelectList() {
		String specsql = Md.getSql("inspSpec.findSpecSelectList");
		List<Map> speclist = Db.selectList(specsql);
		Map<String, Object> specmap = new HashMap<String, Object>();
		if (speclist != null && !speclist.isEmpty()) {
			for (Map map : speclist) {
				if (map.get("id") != null) {
					specmap.put((String) map.get("id"), map.get("text"));
				}
			}
		}
		return specmap;
	}

	/**
	 * 获取周期信息
	 * @return
	 */
	public Map<String, Object> getCycConfigSelectList() {
		String cycsql = Md.getSql("inspCycConfig.findCycConfigSelect");
		List<Map> cyclist = Db.selectList(cycsql);
		Map<String, Object> specmap = new HashMap<String, Object>();
		if (cyclist != null && !cyclist.isEmpty()) {
			for (Map map : cyclist) {
				if (map.get("id") != null) {
					specmap.put((String) map.get("id"), map.get("text"));
				}
			}
		}
		return specmap;
	}
}
